bitkeeper revision 1.556 (3fa7b553guSnjbQHPSIHI8pvbUVpdg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 4 Nov 2003 14:18:59 +0000 (14:18 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 4 Nov 2003 14:18:59 +0000 (14:18 +0000)
setup.c, network.c:
  A couple more bug fixes in xenolinux suspend/resume code.

xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c
xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c

index 748571a98f0c5e684e70fb1350a5534891c12723..31611b433eff548720a0437f60224caebdd1ee61 100644 (file)
@@ -83,10 +83,13 @@ struct net_private
     _id; })
 
 
-static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs)
+static void _dbg_network_int(struct net_device *dev)
 {
-    struct net_device *dev = (struct net_device *)dev_id;
     struct net_private *np = dev->priv;
+
+    if ( np->state == STATE_CLOSED )
+        return;
+    
     printk(KERN_ALERT "tx_full = %d, tx_entries = %d, tx_resp_cons = %d,"
            " tx_req_prod = %d, tx_resp_prod = %d, tx_event = %d, state=%d\n",
            np->tx_full, atomic_read(&np->tx_entries), np->tx_resp_cons, 
@@ -100,6 +103,18 @@ static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs)
 }
 
 
+static void dbg_network_int(int irq, void *unused, struct pt_regs *ptregs)
+{
+    struct list_head *ent;
+    struct net_private *np;
+    list_for_each ( ent, &dev_list )
+    {
+        np = list_entry(ent, struct net_private, list);
+        _dbg_network_int(np->dev);
+    }
+}
+
+
 static int network_open(struct net_device *dev)
 {
     struct net_private *np = dev->priv;
index 9c70c61a71d4677583b37ac3dbfa5c77d399c1d4..b952f123853d242984eda13995ca5d1b6a7cb894 100644 (file)
@@ -46,6 +46,7 @@
 #include <asm/hypervisor.h>
 #include <asm/hypervisor-ifs/dom0_ops.h>
 #include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
 #include <linux/tqueue.h>
 
 /*
@@ -1066,15 +1067,14 @@ static void stop_task(void *unused)
     char name[6];
     int i;
 
-    /* Close down all Ethernet interfaces. */
+    rtnl_lock();
     for ( i = 0; i < 10; i++ )
     {
         sprintf(name, "eth%d", i);
-        if ( (dev = dev_get_by_name(name)) == NULL )
-            continue;
-        dev_close(dev);
-        dev_put(dev);
+        if ( (dev = __dev_get_by_name(name)) != NULL )
+            dev_close(dev);
     }
+    rtnl_unlock();
 
     blkdev_suspend();
 
@@ -1093,15 +1093,14 @@ static void stop_task(void *unused)
 
     blkdev_resume();
 
-    /* Bring up all Ethernet interfaces. */
+    rtnl_lock();
     for ( i = 0; i < 10; i++ )
     {
         sprintf(name, "eth%d", i);
-        if ( (dev = dev_get_by_name(name)) == NULL )
-            continue;
-        dev_open(dev);
-        dev_put(dev);
+        if ( (dev = __dev_get_by_name(name)) != NULL )
+            dev_open(dev);
     }
+    rtnl_unlock();
 }
 
 static struct tq_struct stop_tq;